<?php

namespace hiduoke\base;


/**
 * Class BaseDriver
 * @package hiduoke\base
 * User: liuhongbin
 * Date: 2021-10-03 16:39
 */
abstract class BaseDriver
{

    /**
     * 驱动名称
     * @var string
     */
    protected $name;

    /**
     * BaseDriver constructor.
     * @param string $name 驱动名
     * @param array $config 其他配置
     */
    public function __construct(string $name = '', array $config = [])
    {
        $this->name = $name;
        $this->initialize($config);
    }

    /**
     * 初始化
     * @param array $config
     * @return mixed
     */
    abstract protected function initialize(array $config);

    /**
     * @return string
     */
    public function getName(): string
    {
        return $this->name;
    }
}
